from django.db import models
from datetime import datetime
from django.utils.timezone import now


class Scripts(models.Model):
    id = models.CharField(db_column="c_id", max_length=32, verbose_name=u"主键", primary_key=True, blank=False,
                           null=False)
    name = models.CharField(db_column="c_name", max_length=20, verbose_name="脚本库名称", null=False)
    file_path = models.CharField(max_length=200, db_column="c_file_path")
    is_delete = models.BooleanField(db_column="c_is_delete", default=False)
    create_date = models.DateTimeField(db_column="c_create_date", default=now)
    update_date = models.DateTimeField(db_column="c_update_date", default=now)

    class Meta:
        db_table = "t_scripts"
        verbose_name = "脚本库"
        verbose_name_plural = verbose_name
        ordering = ["create_date"]
